<template>
  <div class="home-page">
    <!-- 轮播图区域 -->
    <section class="hero-section">
      <swiper
        :modules="modules"
        :slides-per-view="1"
        :space-between="0"
        :loop="true"
        :autoplay="{ delay: 5000, disableOnInteraction: false }"
        :pagination="{ clickable: true }"
        :effect="'fade'"
        class="hero-swiper"
      >
        <swiper-slide v-for="banner in banners" :key="banner.id">
          <div class="banner-item" :style="{ backgroundImage: `url(${banner.image})` }">
            <div class="banner-overlay"></div>
            <div class="banner-content">
              <h1 class="banner-title">{{ banner.title }}</h1>
              <p class="banner-subtitle">{{ banner.subtitle }}</p>
              <el-button type="primary" size="large" class="explore-btn">
                查看攻略
              </el-button>
            </div>
          </div>
        </swiper-slide>
      </swiper>
    </section>

    <!-- 搜索栏 -->
    <section class="search-section">
      <div class="search-container">
        <div class="search-box">
          <el-input
            v-model="searchKeyword"
            placeholder="搜索目的地攻略、游记、景点..."
            size="large"
            class="search-input"
          >
            <template #prefix>
              <el-icon><Search /></el-icon>
            </template>
          </el-input>
          <el-button type="primary" size="large" class="search-btn">搜索攻略</el-button>
        </div>
      </div>
    </section>

    <!-- 攻略分类 + 热门攻略（合并） -->
    <section class="guides-section">
      <div class="container">
        <div class="section-header">
          <h2 class="section-title">🔥 热门攻略</h2>
          <p class="section-subtitle">按分类查找你需要的攻略</p>
        </div>
        
        <!-- Tab 分类栏 -->
        <div class="category-tabs">
          <div
            v-for="category in categories"
            :key="category.id"
            class="category-tab"
            :class="{ active: activeCategory === category.id }"
            @click="activeCategory = category.id"
          >
            <span class="tab-icon">{{ category.icon }}</span>
            <span class="tab-name">{{ category.name }}</span>
            <span class="tab-count">{{ category.count }}</span>
          </div>
        </div>

        <!-- 攻略列表 -->
        <div class="guides-grid">
          <div
            v-for="(guide, index) in filteredGuides"
            :key="guide.id"
            class="guide-card"
            :style="{ '--index': index }"
            @click="$router.push('/guides')"
          >
            <div class="guide-image">
              <img :src="guide.cover" :alt="guide.title" />
              <span class="guide-tag">{{ guide.category }}</span>
            </div>
            <div class="guide-content">
              <h3 class="guide-title">{{ guide.title }}</h3>
              <p class="guide-desc">{{ guide.description }}</p>
              <div class="guide-meta">
                <div class="author-info">
                  <img :src="guide.author.avatar" :alt="guide.author.name" class="author-avatar" />
                  <span class="author-name">{{ guide.author.name }}</span>
                </div>
                <div class="guide-stats">
                  <span class="stat-item">
                    <el-icon><View /></el-icon>
                    {{ guide.views }}
                  </span>
                  <span class="stat-item">
                    <el-icon><ChatDotRound /></el-icon>
                    {{ guide.comments }}
                  </span>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- 热门目的地 -->
    <section class="destinations-section">
      <div class="container">
        <div class="section-header">
          <h2 class="section-title">📍 热门目的地</h2>
          <p class="section-subtitle">精选目的地攻略，让你的旅行更轻松</p>
        </div>
        <div class="destinations-layout">
          <!-- 大卡片 -->
          <div class="dest-large" v-if="destinations[0]" @click="$router.push('/attractions')">
            <div class="dest-image">
              <img :src="destinations[0].image" :alt="destinations[0].name" />
              <div class="dest-overlay">
                <div class="dest-content">
                  <h3 class="dest-name">{{ destinations[0].name }}</h3>
                  <p class="dest-slogan">{{ destinations[0].slogan }}</p>
                  <div class="dest-stats">
                    <span class="stat-badge">{{ destinations[0].guides }}篇攻略</span>
                    <span class="stat-badge">{{ destinations[0].notes }}篇游记</span>
                  </div>
                  <el-button type="primary" class="dest-btn" @click.stop="$router.push('/attractions')">查看攻略</el-button>
                </div>
              </div>
            </div>
          </div>
          
          <!-- 小卡片网格 -->
          <div class="dest-grid">
            <div
              v-for="(dest, index) in destinations.slice(1)"
              :key="dest.id"
              class="dest-small"
              :style="{ '--index': index }"
              @click="$router.push('/attractions')"
            >
              <div class="dest-image">
                <img :src="dest.image" :alt="dest.name" />
                <div class="dest-overlay">
                  <h4 class="dest-name">{{ dest.name }}</h4>
                  <p class="dest-slogan">{{ dest.slogan }}</p>
                  <div class="dest-mini-stats">
                    <span>{{ dest.guides }}攻略</span>
                    <span>{{ dest.notes }}游记</span>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- 精选游记 - 无限横向滚动 -->
    <section class="notes-section">
      <div class="container-full">
        <div class="section-header">
          <h2 class="section-title">✍️ 精选游记</h2>
          <p class="section-subtitle">真实旅行者的故事，给你最实用的建议</p>
        </div>
        <div class="notes-marquee">
          <div class="notes-track" ref="notesTrack">
            <div
              v-for="note in [...notes, ...notes]"
              :key="note.id + Math.random()"
              class="note-card"
              @click="$router.push('/community')"
            >
              <div class="note-image">
                <img :src="note.cover" :alt="note.title" />
              </div>
              <div class="note-content">
                <h3 class="note-title">{{ note.title }}</h3>
                <p class="note-excerpt">{{ note.excerpt }}</p>
                <div class="note-footer">
                  <div class="note-author">
                    <img :src="note.author.avatar" :alt="note.author.name" />
                    <div class="author-details">
                      <span class="author-name">{{ note.author.name }}</span>
                      <span class="note-date">{{ note.date }}</span>
                    </div>
                  </div>
                  <div class="note-actions">
                    <span class="action-item">
                      <el-icon><View /></el-icon>
                      {{ note.views }}
                    </span>
                    <span class="action-item">
                      <el-icon><Star /></el-icon>
                      {{ note.likes }}
                    </span>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- 旅行问答 -->
    <section class="qa-section">
      <div class="container">
        <div class="section-header">
          <h2 class="section-title">💬 旅行问答</h2>
          <p class="section-subtitle">解答你的旅行疑问</p>
        </div>
        <div class="qa-container">
          <div v-for="qa in qaList" :key="qa.id" class="qa-card" @click="$router.push('/community')">
            <div class="qa-header">
              <div class="qa-avatar">
                <img :src="qa.questionerAvatar" :alt="qa.questioner" />
              </div>
              <div class="qa-question-box">
                <div class="qa-questioner">{{ qa.questioner }}</div>
                <div class="qa-question">{{ qa.question }}</div>
                <div class="qa-time">{{ qa.time }}</div>
              </div>
            </div>
            <div class="qa-answer-section">
              <div class="qa-answer-header">
                <img :src="qa.answererAvatar" :alt="qa.answerer" class="answerer-avatar" />
                <span class="answerer-name">{{ qa.answerer }}</span>
                <span class="answerer-badge">旅行达人</span>
              </div>
              <div class="qa-answer">{{ qa.answer }}</div>
              <div class="qa-footer">
                <span class="qa-helpful">
                  <el-icon><Select /></el-icon>
                  {{ qa.helpful }}人觉得有用
                </span>
                <span class="qa-reply">{{ qa.replies }}条回复</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </div>
</template>

<script setup>
import { ref, computed, onMounted, onUnmounted } from 'vue'
import { Swiper, SwiperSlide } from 'swiper/vue'
import { Autoplay, Pagination, EffectFade } from 'swiper/modules'
import { Search, View, ChatDotRound, Star, QuestionFilled, Select } from '@element-plus/icons-vue'
import 'swiper/css'
import 'swiper/css/pagination'
import 'swiper/css/effect-fade'

const modules = [Autoplay, Pagination, EffectFade]
const searchKeyword = ref('')
const activeCategory = ref('all')
const notesTrack = ref(null)

// 轮播图数据
const banners = ref([
  {
    id: 1,
    image: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920&q=80',
    title: '发现世界的美好',
    subtitle: '千万旅行者分享的真实攻略'
  },
  {
    id: 2,
    image: 'https://images.unsplash.com/photo-1476514525535-07fb3b4ae5f1?w=1920&q=80',
    title: '你的旅行指南',
    subtitle: '从规划到出发，一站式攻略平台'
  },
  {
    id: 3,
    image: 'https://images.unsplash.com/photo-1488646953014-85cb44e25828?w=1920&q=80',
    title: '分享你的旅行故事',
    subtitle: '记录每一次难忘的旅程'
  }
])

// 攻略分类数据
const categories = ref([
  { id: 'all', name: '全部', icon: '🌟', count: 8956 },
  { id: 'island', name: '海岛游', icon: '🏝️', count: 1256 },
  { id: 'ancient', name: '古城游', icon: '🏛️', count: 987 },
  { id: 'driving', name: '自驾游', icon: '🚗', count: 2134 },
  { id: 'food', name: '美食游', icon: '🍜', count: 1567 },
  { id: 'family', name: '亲子游', icon: '👨‍👩‍👧', count: 1890 },
  { id: 'photo', name: '摄影游', icon: '📷', count: 1234 },
  { id: 'hiking', name: '徒步游', icon: '🥾', count: 876 },
  { id: 'art', name: '文艺游', icon: '🎨', count: 1456 }
])

// 热门攻略数据
const guides = ref([
  {
    id: 1,
    title: '三亚5天4晚深度游攻略',
    description: '详细的行程规划、美食推荐、住宿攻略，带你玩转三亚每个角落，人均3000元搞定！',
    cover: 'https://images.unsplash.com/photo-1559827260-dc66d52bef19?w=600&q=80',
    category: '海岛游',
    categoryId: 'island',
    author: {
      name: '旅行达人小王',
      avatar: 'https://i.pravatar.cc/150?img=11'
    },
    views: '12.5k',
    comments: 328
  },
  {
    id: 2,
    title: '丽江古城完全攻略',
    description: '避坑指南+小众景点+特色美食，本地人带你深度体验纳西文化。',
    cover: 'https://images.unsplash.com/photo-1508804185872-d7badad00f7d?w=600&q=80',
    category: '古城游',
    categoryId: 'ancient',
    author: {
      name: '云南小李',
      avatar: 'https://i.pravatar.cc/150?img=12'
    },
    views: '18.2k',
    comments: 456
  },
  {
    id: 3,
    title: '西藏自驾游完整攻略',
    description: '川藏线+青藏线15天行程，高反应对、装备清单全覆盖。',
    cover: 'https://images.unsplash.com/photo-1519904981063-b0cf448d479e?w=600&q=80',
    category: '自驾游',
    categoryId: 'driving',
    author: {
      name: '自驾老司机',
      avatar: 'https://i.pravatar.cc/150?img=13'
    },
    views: '25.8k',
    comments: 892
  },
  {
    id: 4,
    title: '桂林阳朔3日游攻略',
    description: '漓江竹筏+遇龙河漂流+西街夜景，最佳拍照点位。',
    cover: 'https://images.unsplash.com/photo-1585859695919-c6c4e0c4e5e5?w=600&q=80',
    category: '摄影游',
    categoryId: 'photo',
    author: {
      name: '摄影师阿杰',
      avatar: 'https://i.pravatar.cc/150?img=14'
    },
    views: '9.6k',
    comments: 234
  },
  {
    id: 5,
    title: '厦门鼓浪屿文艺之旅',
    description: '小清新拍照圣地+网红咖啡店，感受海岛文艺气息。',
    cover: 'https://images.unsplash.com/photo-1598948485421-33a1655d3c18?w=600&q=80',
    category: '文艺游',
    categoryId: 'art',
    author: {
      name: '文艺青年小美',
      avatar: 'https://i.pravatar.cc/150?img=15'
    },
    views: '14.3k',
    comments: 567
  },
  {
    id: 6,
    title: '张家界天门山攻略',
    description: '玻璃栈道+天门洞+索道体验，最佳游览路线。',
    cover: 'https://images.unsplash.com/photo-1609137144813-7d9921338f24?w=600&q=80',
    category: '徒步游',
    categoryId: 'hiking',
    author: {
      name: '户外探险家',
      avatar: 'https://i.pravatar.cc/150?img=16'
    },
    views: '11.7k',
    comments: 389
  },
  {
    id: 7,
    title: '成都美食探店攻略',
    description: '火锅、串串、兔头，本地人推荐的地道美食地图。',
    cover: 'https://images.unsplash.com/photo-1555939594-58d7cb561ad1?w=600&q=80',
    category: '美食游',
    categoryId: 'food',
    author: {
      name: '吃货小陈',
      avatar: 'https://i.pravatar.cc/150?img=17'
    },
    views: '16.8k',
    comments: 723
  },
  {
    id: 8,
    title: '亲子游迪士尼攻略',
    description: '带娃玩转迪士尼，省钱省时间的完美攻略。',
    cover: 'https://images.unsplash.com/photo-1566073771259-6a8506099945?w=600&q=80',
    category: '亲子游',
    categoryId: 'family',
    author: {
      name: '超级奶爸',
      avatar: 'https://i.pravatar.cc/150?img=18'
    },
    views: '13.2k',
    comments: 445
  },
  {
    id: 9,
    title: '巴厘岛海岛度假攻略',
    description: '蓝梦岛+乌布+库塔海滩，7天6晚完美行程。',
    cover: 'https://images.unsplash.com/photo-1537996194471-e657df975ab4?w=600&q=80',
    category: '海岛游',
    categoryId: 'island',
    author: {
      name: '海岛控',
      avatar: 'https://i.pravatar.cc/150?img=19'
    },
    views: '19.5k',
    comments: 612
  }
])

// 根据分类筛选攻略
const filteredGuides = computed(() => {
  if (activeCategory.value === 'all') {
    return guides.value
  }
  return guides.value.filter(guide => guide.categoryId === activeCategory.value)
})

// 目的地数据
const destinations = ref([
  {
    id: 1,
    name: '三亚',
    slogan: '东方夏威夷',
    image: 'https://images.unsplash.com/photo-1559827260-dc66d52bef19?w=800&q=80',
    guides: 1256,
    notes: 3428
  },
  {
    id: 2,
    name: '丽江',
    slogan: '艳遇之都',
    image: 'https://images.unsplash.com/photo-1508804185872-d7badad00f7d?w=500&q=80',
    guides: 2134,
    notes: 5672
  },
  {
    id: 3,
    name: '西藏',
    slogan: '心灵净土',
    image: 'https://images.unsplash.com/photo-1519904981063-b0cf448d479e?w=500&q=80',
    guides: 987,
    notes: 2341
  },
  {
    id: 4,
    name: '桂林',
    slogan: '山水甲天下',
    image: 'https://images.unsplash.com/photo-1585859695919-c6c4e0c4e5e5?w=500&q=80',
    guides: 1567,
    notes: 4123
  },
  {
    id: 5,
    name: '厦门',
    slogan: '海上花园',
    image: 'https://images.unsplash.com/photo-1598948485421-33a1655d3c18?w=500&q=80',
    guides: 1890,
    notes: 4567
  }
])

// 精选游记数据
const notes = ref([
  {
    id: 1,
    title: '一个人的云南之旅',
    excerpt: '15天独自旅行，从昆明到大理，从丽江到香格里拉，遇见了最美的风景和最好的自己...',
    cover: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=600&q=80',
    author: {
      name: '独行侠',
      avatar: 'https://i.pravatar.cc/150?img=21'
    },
    date: '2024-01-15',
    views: '8.5k',
    likes: 1234
  },
  {
    id: 2,
    title: '带着爸妈游三亚',
    excerpt: '第一次带父母出游，选择了三亚。看着他们开心的笑容，觉得一切都值得...',
    cover: 'https://images.unsplash.com/photo-1559827260-dc66d52bef19?w=600&q=80',
    author: {
      name: '孝顺的小张',
      avatar: 'https://i.pravatar.cc/150?img=22'
    },
    date: '2024-01-10',
    views: '6.2k',
    likes: 892
  },
  {
    id: 3,
    title: '川藏线自驾日记',
    excerpt: '318国道，中国最美的景观大道。21天的自驾之旅，每一天都是新的惊喜...',
    cover: 'https://images.unsplash.com/photo-1519904981063-b0cf448d479e?w=600&q=80',
    author: {
      name: '自驾爱好者',
      avatar: 'https://i.pravatar.cc/150?img=23'
    },
    date: '2024-01-05',
    views: '12.3k',
    likes: 2156
  },
  {
    id: 4,
    title: '桂林山水画中游',
    excerpt: '漓江的水，阳朔的山，每一帧都是明信片般的美景...',
    cover: 'https://images.unsplash.com/photo-1585859695919-c6c4e0c4e5e5?w=600&q=80',
    author: {
      name: '摄影新手',
      avatar: 'https://i.pravatar.cc/150?img=24'
    },
    date: '2023-12-28',
    views: '5.7k',
    likes: 678
  },
  {
    id: 5,
    title: '厦门慢生活体验',
    excerpt: '在鼓浪屿的小巷里漫步，在海边的咖啡馆发呆，这就是我想要的生活...',
    cover: 'https://images.unsplash.com/photo-1598948485421-33a1655d3c18?w=600&q=80',
    author: {
      name: '文艺青年',
      avatar: 'https://i.pravatar.cc/150?img=25'
    },
    date: '2023-12-20',
    views: '7.8k',
    likes: 1023
  }
])

// 旅行问答数据
const qaList = ref([
  {
    id: 1,
    questioner: '旅行小白',
    questionerAvatar: 'https://i.pravatar.cc/150?img=31',
    question: '第一次去西藏需要注意什么？会不会有高原反应？',
    time: '2小时前',
    answerer: '西藏通',
    answererAvatar: 'https://i.pravatar.cc/150?img=32',
    answer: '建议提前一周开始服用红景天预防高反，到达后前两天不要洗澡，多喝水多休息。携带防晒霜、墨镜、保暖衣物。最好选择5-10月出行，天气较好。如果出现严重高反症状，及时就医或吸氧。',
    helpful: 156,
    replies: 23
  },
  {
    id: 2,
    questioner: '省钱达人',
    questionerAvatar: 'https://i.pravatar.cc/150?img=33',
    question: '三亚旅游什么时候去最便宜？有什么省钱攻略吗？',
    time: '5小时前',
    answerer: '旅游规划师',
    answererAvatar: 'https://i.pravatar.cc/150?img=34',
    answer: '避开春节、国庆等旺季，5-9月是淡季，机票酒店都会便宜很多。虽然天气热一些，但海边还是很舒服的。建议提前订酒店，可以拿到更好的价格。海鲜可以去第一市场自己买然后找加工店，比餐厅便宜一半。',
    helpful: 89,
    replies: 15
  },
  {
    id: 3,
    questioner: '摄影爱好者',
    questionerAvatar: 'https://i.pravatar.cc/150?img=35',
    question: '桂林漓江什么时候拍照最美？有推荐的机位吗？',
    time: '1天前',
    answerer: '摄影师老王',
    answererAvatar: 'https://i.pravatar.cc/150?img=36',
    answer: '4-10月是最佳拍摄季节，尤其是雨后的清晨，云雾缭绕特别美。推荐机位：兴坪古镇的老寨山（20元人民币背景）、相公山（日出）、黄布倒影。建议早上6点前到达，光线最好。',
    helpful: 234,
    replies: 42
  }
])

// 无限滚动动画
let scrollAnimation = null

onMounted(() => {
  if (notesTrack.value) {
    const track = notesTrack.value
    let scrollPosition = 0
    const scrollSpeed = 0.5 // 滚动速度

    const animate = () => {
      scrollPosition += scrollSpeed
      
      // 当滚动到一半时重置位置，实现无限循环
      if (scrollPosition >= track.scrollWidth / 2) {
        scrollPosition = 0
      }
      
      track.style.transform = `translateX(-${scrollPosition}px)`
      scrollAnimation = requestAnimationFrame(animate)
    }

    animate()

    // 鼠标悬停时暂停滚动
    track.addEventListener('mouseenter', () => {
      if (scrollAnimation) {
        cancelAnimationFrame(scrollAnimation)
      }
    })

    track.addEventListener('mouseleave', () => {
      animate()
    })
  }
})

onUnmounted(() => {
  if (scrollAnimation) {
    cancelAnimationFrame(scrollAnimation)
  }
})
</script>

<style scoped lang="less">
.home-page {
  min-height: 100vh;
  background: #f8f9fa;
}

// 轮播图区域
.hero-section {
  height: 500px;
  position: relative;

  .hero-swiper {
    height: 100%;
  }

  .banner-item {
    height: 500px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      135deg,
      rgba(102, 126, 234, 0.6) 0%,
      rgba(118, 75, 162, 0.5) 100%
    );
  }

  .banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    animation: fadeInUp 1s ease-out;
  }

  .banner-title {
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 16px 0;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  }

  .banner-subtitle {
    font-size: 20px;
    margin: 0 0 32px 0;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
  }

  .explore-btn {
    padding: 14px 40px;
    font-size: 16px;
    border-radius: 50px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    border: none;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;

    &:hover {
      transform: translateY(-3px);
      box-shadow: 0 12px 28px rgba(255, 107, 107, 0.5);
    }
  }
}

// 搜索栏
.search-section {
  margin-top: -40px;
  position: relative;
  z-index: 10;
  padding: 0 24px;

  .search-container {
    max-width: 900px;
    margin: 0 auto;
  }

  .search-box {
    display: flex;
    gap: 12px;
    background: #fff;
    padding: 10px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  }

  .search-input {
    flex: 1;

    :deep(.el-input__wrapper) {
      border-radius: 50px;
      border: none;
      box-shadow: none;
      padding: 6px 20px;
    }
  }

  .search-btn {
    border-radius: 50px;
    padding: 0 32px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    border: none;
  }
}

// 通用容器
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-full {
  max-width: 100%;
  padding: 0;
}

// 通用区块标题
.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 12px 0;
}

.section-subtitle {
  font-size: 16px;
  color: #666;
  margin: 0;
}

// 攻略分类 + 热门攻略
.guides-section {
  padding: 80px 0;
}

// Tab 分类栏
.category-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 40px;
  padding: 0 24px;
}

.category-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #fff;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  }

  &.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);

    .tab-count {
      background: rgba(255, 255, 255, 0.25);
      color: #fff;
    }
  }

  .tab-icon {
    font-size: 20px;
  }

  .tab-name {
    font-size: 15px;
    font-weight: 600;
  }

  .tab-count {
    font-size: 12px;
    background: rgba(0, 0, 0, 0.05);
    color: #666;
    padding: 2px 10px;
    border-radius: 12px;
    transition: all 0.3s ease;
  }
}

// 攻略网格
.guides-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.guide-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: calc(var(--index) * 0.1s);
  display: flex;
  flex-direction: column;

  &:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);

    .guide-image img {
      transform: scale(1.05);
    }
  }

  .guide-image {
    height: 220px;
    overflow: hidden;
    position: relative;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.5s ease;
    }

    .guide-tag {
      position: absolute;
      top: 12px;
      right: 12px;
      background: rgba(255, 255, 255, 0.95);
      color: #ff6b6b;
      padding: 6px 16px;
      border-radius: 20px;
      font-size: 13px;
      font-weight: 600;
    }
  }

  .guide-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .guide-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 10px 0;
    line-height: 1.4;
  }

  .guide-desc {
    font-size: 14px;
    color: #666;
    margin: 0 0 16px 0;
    line-height: 1.6;
    flex: 1;
  }

  .guide-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
  }

  .author-info {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
  }

  .author-name {
    font-size: 13px;
    color: #666;
  }

  .guide-stats {
    display: flex;
    gap: 16px;
    color: #999;
    font-size: 13px;
  }

  .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
  }
}

// 热门目的地
.destinations-section {
  padding: 60px 0;
  background: linear-gradient(135deg, #f0f4ff 0%, #fff5f7 100%);
}

.destinations-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}

.dest-large {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  transition: all 0.4s ease;
  animation: fadeInLeft 0.8s ease-out;
  cursor: pointer;

  &:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);

    .dest-image img {
      transform: scale(1.1);
    }
  }

  .dest-image {
    height: 600px;
    position: relative;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.6s ease;
    }

    .dest-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.75) 100%);
      display: flex;
      align-items: flex-end;
      padding: 40px;
    }

    .dest-content {
      color: #fff;
    }

    .dest-name {
      font-size: 48px;
      font-weight: 700;
      margin: 0 0 8px 0;
    }

    .dest-slogan {
      font-size: 20px;
      margin: 0 0 24px 0;
      opacity: 0.9;
    }

    .dest-stats {
      display: flex;
      gap: 16px;
      margin-bottom: 24px;
    }

    .stat-badge {
      background: rgba(255, 255, 255, 0.3);
      padding: 8px 20px;
      border-radius: 20px;
      font-size: 14px;
      font-weight: 500;
    }

    .dest-btn {
      background: #fff;
      color: #ff6b6b;
      border: none;
      padding: 12px 32px;
      border-radius: 25px;
      font-weight: 600;

      &:hover {
        background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
        color: #fff;
      }
    }
  }
}

.dest-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.dest-small {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  animation: fadeInScale 0.5s ease-out forwards;
  animation-delay: calc(var(--index) * 0.1s);

  &:hover {
    transform: translateX(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);

    .dest-image img {
      transform: scale(1.1);
    }
  }

  .dest-image {
    height: 130px;
    position: relative;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.5s ease;
    }

    .dest-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(135deg, rgba(102, 126, 234, 0.7) 0%, rgba(118, 75, 162, 0.7) 100%);
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: 20px;
      color: #fff;
    }

    .dest-name {
      font-size: 24px;
      font-weight: 700;
      margin: 0 0 4px 0;
    }

    .dest-slogan {
      font-size: 13px;
      margin: 0 0 12px 0;
      opacity: 0.95;
    }

    .dest-mini-stats {
      display: flex;
      gap: 12px;
      font-size: 12px;

      span {
        background: rgba(255, 255, 255, 0.3);
        padding: 4px 12px;
        border-radius: 12px;
      }
    }
  }
}

// 精选游记 - 无限横向滚动
.notes-section {
  padding: 60px 0;
  background: #fff;
  overflow: hidden;
}

.notes-marquee {
  overflow: hidden;
  padding: 20px 0 40px;
}

.notes-track {
  display: flex;
  gap: 24px;
  will-change: transform;
}

.note-card {
  flex: 0 0 400px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;

  &:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  }

  .note-image {
    height: 240px;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.5s ease;
    }

    &:hover img {
      transform: scale(1.05);
    }
  }

  .note-content {
    padding: 24px;
  }

  .note-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px 0;
  }

  .note-excerpt {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

  .note-author {
    display: flex;
    align-items: center;
    gap: 12px;

    img {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      object-fit: cover;
    }

    .author-details {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .author-name {
      font-size: 13px;
      font-weight: 600;
      color: #1a1a1a;
    }

    .note-date {
      font-size: 12px;
      color: #999;
    }
  }

  .note-actions {
    display: flex;
    gap: 16px;
    color: #999;
    font-size: 13px;
  }

  .action-item {
    display: flex;
    align-items: center;
    gap: 4px;
  }
}

// 旅行问答
.qa-section {
  padding: 60px 0 80px;
  background: #f8f9fa;
}

.qa-container {
  max-width: 1000px;
  margin: 0 auto;
}

.qa-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  cursor: pointer;

  &:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: translateX(8px);
  }

  .qa-header {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
  }

  .qa-avatar {
    flex-shrink: 0;

    img {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      object-fit: cover;
      border: 3px solid #fff;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
  }

  .qa-question-box {
    flex: 1;
    background: #fff;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }

  .qa-questioner {
    font-size: 14px;
    font-weight: 600;
    color: #ff6b6b;
    margin-bottom: 8px;
  }

  .qa-question {
    font-size: 16px;
    color: #1a1a1a;
    line-height: 1.6;
    margin-bottom: 8px;
  }

  .qa-time {
    font-size: 12px;
    color: #999;
  }

  .qa-answer-section {
    background: rgba(255, 107, 107, 0.05);
    padding: 20px;
    border-radius: 16px;
    border-left: 4px solid #ff6b6b;
  }

  .qa-answer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;

    .answerer-avatar {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      object-fit: cover;
    }

    .answerer-name {
      font-size: 14px;
      font-weight: 600;
      color: #1a1a1a;
    }

    .answerer-badge {
      background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
      color: #fff;
      padding: 4px 12px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 600;
    }
  }

  .qa-answer {
    font-size: 15px;
    color: #333;
    line-height: 1.8;
    margin-bottom: 16px;
  }

  .qa-footer {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: #666;
  }

  .qa-helpful {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ff6b6b;
    font-weight: 500;
  }

  .qa-reply {
    color: #999;
  }
}

// 动画
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

// 响应式设计
@media (max-width: 1200px) {
  .guides-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .destinations-layout {
    grid-template-columns: 1fr;
  }

  .dest-large .dest-image {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .hero-section {
    height: 350px;

    .banner-item {
      height: 350px;
    }

    .banner-title {
      font-size: 28px;
    }

    .banner-subtitle {
      font-size: 16px;
    }
  }

  .search-section {
    margin-top: -30px;

    .search-box {
      flex-direction: column;
      border-radius: 20px;
    }

    .search-btn {
      width: 100%;
    }
  }

  .section-title {
    font-size: 24px;
  }

  .guides-grid {
    grid-template-columns: 1fr;
  }

  .category-tabs {
    gap: 12px;
  }

  .category-tab {
    padding: 10px 16px;
    font-size: 14px;
  }

  .qa-card {
    padding: 20px;
  }

  .qa-header {
    flex-direction: column;
  }
}
</style>
